﻿namespace BookSourceVerification.handlers;

public class HandlerResult
{
    // 存放handler处理的结果
    public bool Flag { get; private set; }

    // 存放handler数据
    public object? Data { get; private set; }

    public bool Final { get; private set; }

    public HandlerResult()
    {
        Flag = true;
    }

    public void Success()
    {
        Flag = true;
    }

    public void Success(object? data)
    {
        Flag = true;
        Data = data;
    }

    public void Fail()
    {
        Flag = false;
    }

    public void Fail(object? data)
    {
        Flag = false;
        Data = data;
    }

    public void FinalSuccess()
    {
        this.Final = true;
        Flag = true;
    }
}